# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=perl-YAML-Syck
pkgver=1.29
pkgrel=1
pkgdesc="Fast, lightweight YAML loader and dumper"
arch=('i686' 'x86_64')
url="http://search.cpan.org/dist/YAML-Syck/"
license=('BSD' 'custom')
depends=('perl')
groups=('perl-modules')
options=('!emptydirs')
source=(http://www.cpan.org/authors/id/T/TO/TODDR/YAML-Syck-$pkgver.tar.gz
        'msysize.patch')
md5sums=('0f906ae8b3747039b26c29c481cda607'
         'f52d1852bb84c84c40d0a0c47d3ee0de')

prepare() {
  cd YAML-Syck-$pkgver
  patch -p1 -i ${srcdir}/msysize.patch
}

build() {
  cd YAML-Syck-$pkgver
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd YAML-Syck-$pkgver
  make test
}

package() {
  cd YAML-Syck-$pkgver
  make install DESTDIR="${pkgdir}"
  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # fix permissons
  find ${pkgdir}/usr -type f \( -name *.dll -o -name *.exe \) | xargs chmod 0755
}
